<template>
	<view class="page">
		<view class="flex benben-position-layout flex flex-wrap align-center personalInformation_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between flex-sub personalInformation_fd0_0'>
				<view class='flex flex-wrap align-center' @tap.stop="handleJumpDiy" data-type="back" data-url="1">
					<text class='fu-iconfont2  personalInformation_fd0_0_c0_c0' @tap.stop="handleJumpDiy"
						data-type="back" data-url="1">&#xE794;</text>
				</view>
				<text class='personalInformation_fd0_0_c1'>续租列表</text>
				<view class='flex flex-wrap align-center personalInformation_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<view class="loading_css" v-if="isShow">
			<u-loading size="36" color="#1A66FA"></u-loading>
			<view>加载中</view>
		</view>
		<template v-else>
			<view class="content_bg" v-for="(item, index) in list" :key="index">
				<view class="infor_item flex align-center justify-between">
					<view class="infor_item_le">续租金额</view>
					<view class="infor_item_ri_1">￥{{item.money}}</view>
				</view>
				<view class="infor_item flex align-center justify-between">
					<view class="infor_item_le">续租时间</view>
					<view class="infor_item_ri">
						<text>{{item.repay_at | setTime}}</text>
					</view>
				</view>
				<view class="infor_item flex align-center justify-end">
					<view class="offline_text flex align-center justify-center"
						@tap.stop="openCancel(item.id)">取消续租</view>
				</view>
			</view>
			<view class="noData" v-if="list.length == 0 && !isShow">
				<image :src='STATIC_URL+"no.png"'></image>
			</view>
		</template>
		
		
		<u-popup v-model="priceShow" border-radius="24" :mask="true" :mask-close-able="true" mode='center'>
			<!---删除历史记录弹窗flex布局开始-->
			<view class="flex flex-direction flex-wrap align-center search_flex_2">
				<text class='search_fd2_0'>提示</text>
				<text class='search_fd2_1'>确定取消续租吗？</text>
				<view class='flex flex-wrap align-center search_fd2_2'>
					<view class='search_fd2_2_c0 flex align-center justify-center'
						@tap.stop="priceShow=false">取消</view>
					<view class='search_fd2_2_c1 flex align-center justify-center' @tap.stop="confirmFache()">确认</view>
				</view>
			</view>
		</u-popup>
	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},

		data() {
			return {
				isShow: true,
				priceShow: false,
				list: [],
				relet_id: "",
			};
		},
		computed: {

		},
		watch: {},
		filters: {
			setTime(value) {
				return value.slice(0, value.length - 3);
			}
		},
		onLoad(options) {
			let {order_id} = options;
			if (order_id !== undefined) this.order_id = order_id;
			this.getRenewal();
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			// 获取续租列表  renewalList
			getRenewal() {
				this.$api.post(global.apiUrls.renewalList, {
					order_id: this.order_id
				}).then(res => {
					// console.log(res);
					this.isShow = false;
					if (res.data.code == 1) {
						this.list = res.data.data;
					} else {
						this.$message.info(res.data.info);
					}
				}).catch(err => {
					console.log(err);
				})
			},
			openCancel(id) {
				this.relet_id = id;
				this.priceShow = true;
			},
			confirmFache() {
				this.priceShow = false;
				this.$api.post(global.apiUrls.cancelRenewal, {
					relet_id: this.relet_id
				}).then(res => {
					this.$message.info(res.data.info);
					if (res.data.code == 1) {
						this.isShow = true;
						this.getRenewal();
					}
				})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.personalInformation_picker2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		padding: 40rpx 30rpx 30rpx 30rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
	}
	
	.personalInformation_picker2_0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #BFBFBF;
	}
	
	.personalInformation_picker2_0_c1 {
		font-weight: bold;
		font-size: 34rpx;
		color: #000000;
	}
	.select_btn {
		background: #fff;
		padding: 12rpx 30rpx 28rpx;
	}
	.select_btn_1 {
		width: 236rpx;
		height: 96rpx;
		background: #F6F7FB;
		border-radius: 16rpx;
		font-weight: 500;
		font-size: 30rpx;
		color: #222222;
	}
	.select_btn_2 {
		width: 436rpx;
		height: 96rpx;
		background: #1A66FA;
		border-radius: 16rpx;
		font-weight: 500;
		font-size: 30rpx;
		color: #fff;
	}
	
	
	
	.deductible_popup {
		width: 626rpx;
		position: relative;
		.pop_title {
			text-align: center;
			font-weight: 800;
			font-size: 36rpx;
			color: #222222;
			padding: 40rpx 0 12rpx;
		}
		.pop_tips {
			padding: 0 38rpx;
			margin-top: 16rpx;
			.tips_le {
				width: 8rpx;
				height: 8rpx;
				border-radius: 50%;
				background: #1A66FA;
				margin-right: 16rpx;
				transform: translateY(16rpx);
			}
			.tips_ri {
				width: calc(100% - 24rpx);
				font-weight: 400;
				font-size: 28rpx;
				color: #222222;
				line-height: 36rpx;
			}
		}
		.pop_btn {
			width: 548rpx;
			height: 88rpx;
			background: #1A66FA;
			border-radius: 16rpx;
			font-weight: 500;
			font-size: 32rpx;
			color: #FFFFFF;
			margin: 66rpx auto 52rpx;
		}
		.pop_bg {
			width: 100%;
			height: 220rpx;
			background: linear-gradient( 180deg, rgba(26,102,250,0.2) 0%, rgba(255,255,255,0) 100%);
			border-radius: 32rpx 32rpx 0px 0px;
			position: absolute;
			top: 0;
			left: 0;
		}
		.title_text {
			padding: 36rpx 40rpx 22rpx;
			font-weight: 500;
			font-size: 30rpx;
			color: #000000;
		}
		.input_view {
			width: 548rpx;
			height: 88rpx;
			border-radius: 16rpx;
			border: 2rpx solid #1A66FA;
			padding: 24rpx 0rpx;
			margin: 0 40rpx;
			.input {
				padding: 0 30rpx;
			}
			.money_icon {
				font-weight: bold;
				font-size: 32rpx;
				color: #1A66FA;
				margin-left: 30rpx;
			}
		}
		.operation {
			margin: 46rpx 0;
			padding: 0 40rpx;
			.operation_1 {
				width: 266rpx;
				height: 88rpx;
				background: #F6F7FB;
				border-radius: 16rpx;
				font-weight: 500;
				font-size: 32rpx;
				color: #222222;
			}
			.operation_2 {
				width: 266rpx;
				height: 88rpx;
				background: #1A66FA;
				border-radius: 16rpx;
				font-weight: 500;
				font-size: 32rpx;
				color: #fff;
			}
		}
		
		.charge_list {
			overflow: hidden;
			padding: 10rpx 40rpx 0;
			position: relative;
			z-index: 10;
			.charge_item {
				float: left;
				width: 174rpx;
				height: 80rpx;
				background: #F6F7FB;
				border-radius: 16rpx;
				font-weight: 400;
				font-size: 28rpx;
				color: #222222;
				margin-bottom: 10rpx;
				margin-right: 10rpx;
				image {
					width: 24rpx;
					height: 24rpx;
					margin-right: 4rpx;
				}
			}
			.active_item {
				color: #1A66FA;
				background: #F1F6FF;
				border: 2rpx solid #AAC7FF;
			}
			.charge_item:nth-child(3n+3) {
				margin-right: 0;
			}
		}
	}
	.page_fo {
		width: 100%;
		height: 120rpx;
		background: #fff;
		position: fixed;
		left: 0;
		bottom: 0;
		z-index: 10;
		padding: 10rpx 24rpx 14rpx;

		.page_fo_le {
			padding-left: 24rpx;

			.fo_le_1 {
				font-weight: 400;
				font-size: 28rpx;
				color: #222222;
			}

			.fo_le_2 {
				font-size: 24rpx;
				font-weight: bold;
				color: #FF532E;
			}

			.fo_le_3 {
				font-size: 32rpx;
				font-weight: bold;
				color: #FF532E;
			}
		}

		.page_fo_ri {
			width: 408rpx;
			height: 96rpx;
			background: #1A66FA;
			border-radius: 16rpx;
			font-weight: bold;
			font-size: 30rpx;
			color: #FFFFFF;
		}
	}

	.content_bg {
		background: #fff;
		border-radius: 16rpx;
		margin: 16rpx 24rpx 0;
		padding: 8rpx 24rpx;
	}

	.add_price {
		background: #F0F5FF;
		border-radius: 16rpx;
		border: 2rpx solid #A5BAE4;
		padding: 26rpx 0;
		font-weight: 500;
		font-size: 30rpx;
		color: #1A66FA;

		image {
			width: 44rpx;
			height: 44rpx;
		}
	}

	.infor_item {
		padding: 16rpx 0;
		// border-bottom: 1px solid #eee;

		.infor_item_le {
			font-weight: 500;
			font-size: 28rpx;
			color: #000000;
		}

		.infor_item_le_1 {
			font-weight: 400;
			font-size: 28rpx;
			color: #222222;
		}

		.infor_item_ri {
			font-weight: 400;
			font-size: 28rpx;
			color: #666666;
		}

		.infor_item_ri_1 {
			font-weight: bold;
			font-size: 30rpx;
			color: #222222;
			display: flex;
			align-items: center;
		}

		.infor_item_ri_2 {
			font-weight: 400;
			font-size: 30rpx;
			color: #1A66FA;
		}

		.infor_item_ri_3 {
			font-weight: bold;
			font-size: 30rpx;
			color: #FF532E;
		}

		.infor_item_ri_4 {
			font-weight: 400;
			font-size: 30rpx;
			color: #222222;
		}

		.infor_item_icon {
			width: 38rpx;
			height: 38rpx;
			margin-left: 10rpx;
		}

		.coupon_icon {
			width: 40rpx;
			height: 40rpx;
			margin-right: 12rpx;
		}

		.item_text_edit {
			font-weight: 400;
			font-size: 28rpx;
			color: #1A66FA;
			margin-left: 14rpx;
		}
		.offline_text {
			border: 1px solid #eee;
			width: 160rpx;
			height: 52rpx;
			border-radius: 8rpx;
			font-size: 24rpx;
			color: #666;
		}
	}

	.no_line {
		border-bottom: 0;
	}

	.personalInformation_picker2_0 {
		border-bottom: 1px solid #eee;
		background: #fff;
		background-size: 100% !important;
		padding: 0rpx 32rpx 0rpx 32rpx;
		border-radius: 16rpx 16rpx 0rpx 0rpx;
		background-size: 100% auto !important;
		height: 100rpx;
	}

	.personalInformation_picker2_0_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #BFBFBF;
	}

	.personalInformation_picker2_0_c1 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
	}

	.personalInformation_picker2_0_c2 {
		color: rgba(44, 143, 255, 1);
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
	}

	.personalInformation_fd1_0 {
		// margin-top: 32rpx;
		height: 96rpx;
		border-top: 1px solid #eee;
	}

	.personalInformation_fd1_0_c0 {
		font-weight: 400;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.6);
	}

	.personalInformation_fd1_0_c1_image {
		width: 72rpx;
		height: 72rpx;
		border-radius: 50%;
	}

	.personalInformation_fd1_1 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_1_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_1_c1 {
		font-weight: 400;
		font-size: 28rpx;
		color: #222222;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.personalInformation_fd1_2 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_2_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_2_c1 {
		font-size: 32rpx;
		font-weight: 400;
		color: #333;
		text-align: right;
		margin: 0rpx 0rpx 0rpx 24rpx;
	}

	.personalInformation_fd1_3 {
		border-bottom: 1px solid #eee;
		height: 109rpx;
	}

	.personalInformation_fd1_3_c0 {
		line-height: 45rpx;
		font-size: 32rpx;
		font-weight: 400;
		color: #333333;
	}

	.personalInformation_fd1_3_c1 {
		font-weight: 500;
		font-size: 28rpx;
		color: rgba(0, 0, 0, 0.8);
	}

	.personalInformation_flex_1 {
		background: #fff;
		border-radius: 16rpx;
		padding: 24rpx 24rpx 0rpx 24rpx;
		margin: 16rpx 24rpx 0;
	}

	.personalInformation_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		height: 88rpx;
	}

	.personalInformation_fd0_0_c0_c0 {
		font-size: 32rpx;
		font-weight: 500;
		color: #111;
	}

	.personalInformation_fd0_0_c1 {
		font-size: 32rpx;
		font-weight: bold;
		color: #111111;
	}

	.personalInformation_fd0_0_c2 {
		width: 36rpx;
		height: 36rpx;
	}

	.personalInformation_flex_0 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background: url(https://speed.zhongchuxing.com/gjdimages/page_bg.png) no-repeat;
		background-size: 100% auto !important;
	}

	.page {
		min-height: calc(100vh - var(--window-bottom));
		background: url(https://speed.zhongchuxing.com/gjdimages/page_bg.png) no-repeat #f6f7fb;
		background-size: 100% auto !important;
	}
	
	
	.search_flex_2 {
		background: #fff;
		// margin: 0rpx 105rpx 0rpx 105rpx;
		border-radius: 25rpx 25rpx 25rpx 25rpx;
		padding: 40rpx 0rpx 0rpx 0rpx;
	}
	
	.search_fd2_2_c1 {
		background: transparent;
		line-height: 90rpx;
		border-radius: 0rpx 0rpx 16rpx 0rpx;
		font-size: 32rpx;
		color: #1A66FA;
		width: 269rpx;
		height: 90rpx;
	}
	
	.search_fd2_2_c0 {
		border-right: 1px solid #EEEEEE;
		background: transparent;
		line-height: 90rpx;
		border-radius: 0rpx 0rpx 0rpx 16rpx;
		font-size: 32rpx;
		color: #999;
		height: 90rpx;
		width: 270rpx;
	}
	
	.search_fd2_2 {
		border-top: 1px solid #eee;
	}
	
	.search_fd2_1 {
		font-size: 32rpx;
		font-weight: 500;
		color: #333333;
		margin: 48rpx 0rpx 60rpx 0rpx;
	}
	
	.search_fd2_0 {
		color: #333333;
		font-size: 36rpx;
		font-weight: 500;
		line-height: 45rpx;
	}
</style>